예제 #1
0
        void SpawnLifeOrbs(Player player, Entity target, int damage)
        {
            int projectileNumber = Type2.GetValue();

            for (int i = 0; i < projectileNumber; i++)
            {
                Vector2 direction  = Main.rand.NextVector2Unit();
                Vector2 velocity   = direction * Main.rand.NextFloat(5, 10);
                Vector2 projTarget = player.Center + Main.rand.NextVector2Circular(player.width * 1.5f, player.height * 1.5f);
                int     heal       = (int)MathHelper.Clamp(damage * Type3.GetValue(), 1, 999999);
                Projectile.NewProjectile(target.Center, velocity, ModContent.ProjectileType <LifeOrb>(), heal, 0, player.whoAmI, projTarget.X, projTarget.Y);
            }
        }
예제 #2
0
        void SpawnIcycles(Player player, Entity target, int hitDamage)
        {
            PlaySound(player);

            int projectileNumber = Type2.GetValue();

            for (int i = 0; i < projectileNumber; i++)
            {
                Vector2 velocity = (target.Center - player.Center).SafeNormalize(Vector2.Zero).RotatedBy(Main.rand.NextFloat(-0.4f, 0.4f)) * Main.rand.NextFloat(7f, 20f);
                int     damage   = (int)MathHelper.Clamp(hitDamage * Type3.GetValue(), 1, 999999);
                Projectile.NewProjectile(player.Center, velocity, ModContent.ProjectileType <Icicle>(), damage, 0, player.whoAmI);
            }
        }
예제 #3
0
        void SpawnChainLightning(Player player, Entity target, int hitDamage, bool isNPC)
        {
            PlaySound(player);
            int damage = (int)MathHelper.Clamp(hitDamage * Type2.GetValue(), 1, 999999);

            Projectile.NewProjectile(
                position: player.Center,
                velocity: new Vector2(isNPC ? 1 : 0, target.whoAmI),
                Type: ModContent.ProjectileType <ChainLightning>(),
                Damage: damage,
                KnockBack: 0,
                Owner: player.whoAmI,
                ai0: Type3.GetValue());
        }
예제 #4
0
        void SpawnFrostPulse(Player player, Entity target, int hitDamage)
        {
            PlaySound(player);
            Vector2 velocity = (target.Center - player.Center).SafeNormalize(Vector2.One) * Main.rand.NextFloat(10f, 20f);
            int     damage   = (int)MathHelper.Clamp(hitDamage * Type2.GetValue(), 1, 999999);

            Projectile.NewProjectile(
                position: player.Center,
                velocity: velocity,
                Type: ModContent.ProjectileType <FrostPulse>(),
                Damage: damage,
                KnockBack: 0,
                Owner: player.whoAmI,
                ai0: Type3.GetValue());
        }
예제 #5
0
        void SpawnMeteor(Player player, Entity target, int hitDamage)
        {
            float   height         = 768f;
            Vector2 spawnOffset    = new Vector2(0, -height).RotatedBy(Main.rand.NextFloat(-0.3f, 0.3f));
            Vector2 targetPosition = target.Center + Main.rand.NextVector2Circular(target.width, target.height);
            Vector2 spawnPosition  = targetPosition + spawnOffset;

            PlaySound(spawnPosition);

            int damage = (int)MathHelper.Clamp(hitDamage * Type2.GetValue(), 1, 999999);

            Projectile.NewProjectile(
                targetPosition + spawnOffset,
                targetPosition,
                ModContent.ProjectileType <Meteor>(),
                damage,
                0,
                player.whoAmI,
                ai0: hitDamage * Type3.GetValue());
        }
예제 #6
0
        void Hit(Item item, Player player, int hitDamage)
        {
            if (item == player.HeldItem)
            {
                int damage = (int)MathHelper.Clamp(hitDamage * Type2.GetValue(), 1, 999999);

                int intervalTicks = (int)Math.Round(Type3.GetValue() * 60);
                if (intervalTicks < 1)
                {
                    intervalTicks = 1;
                }

                int durationTicks = (int)Math.Round(Type1.GetValue() * 60);
                if (durationTicks < 1)
                {
                    durationTicks = 1;
                }

                player.GetModPlayer <BuffPlayer>().AddStaticStrikeBuff(player, damage, intervalTicks, durationTicks, true);
            }
        }
예제 #7
0
        public override string GetTolltipText(Item item)
        {
            string plusMinus = Type2.GetValue() >= 0 ? "+" : "-";

            return($"Spend {Type1.GetValueFormat()}% mana to increase damage by {plusMinus}{Type2.GetValueFormat()}%");
        }
예제 #8
0
 public override void UpdateEquip(Item item, AffixItemPlayer player)
 {
     player.player.GetModPlayer <AffixItemPlayer>().goldDropChances.AddOrUpdate(this, Type1.GetValue(), Type2.GetValue());
 }
예제 #9
0
        public override void PostHurt(Item item, Player player, bool pvp, bool quiet, double damage, int hitDirection, bool crit)
        {
            if (AffixItemItem.IsArmorEquipped(item, player) && (Main.GameUpdateCount - lastProcTime) >= (int)Math.Round(Type3.GetValue() * 60))
            {
                player.GetModPlayer <BuffPlayer>().AddGreavesMoveSpeedBuff(player, Type1.GetValue(), (int)Math.Round(Type2.GetValue() * 60), false);

                lastProcTime = Main.GameUpdateCount;
            }
        }
        public override string GetTolltipText(Item item)
        {
            char plusMinus = Type2.GetValue() < 0 ? '-' : '+';

            return($"{ Type1.GetValueFormat() }% chance to Shock({ plusMinus }{ Type2.GetValueFormat() }%)");
        }
예제 #11
0
        public override bool PreHurt(Item item, Player player, bool pvp, bool quiet, ref float damageMultiplier, ref int hitDirection, ref bool crit, ref bool customDamage, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource)
        {
            if (AffixItemItem.IsArmorEquipped(item, player) && (Main.GameUpdateCount - lastProcTime) >= (int)Math.Round(Type2.GetValue() * 60))
            {
                damageMultiplier += Type1.GetValue();
                lastProcTime      = Main.GameUpdateCount;
            }

            return(true);
        }
예제 #12
0
 void Hit(Item item, Player player, Player target, ref float damageMultiplier)
 {
     if (item == player.HeldItem && (Main.GameUpdateCount - lastProcTime) >= (int)Math.Round(Type2.GetValue() * 60))
     {
         Crit(target, ref damageMultiplier);
     }
 }
예제 #13
0
        void SpawnNova(Item item, Player player, int damageTaken)
        {
            if (AffixItemItem.IsArmorEquipped(item, player) && (Main.GameUpdateCount - lastProcTime) >= (int)Math.Round(Type3.GetValue() * 60))
            {
                PlaySound(player);

                Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType <ReflectNova>(), (int)Math.Round(damageTaken * Type1.GetValue()), 0, player.whoAmI, Type2.GetValue());

                lastProcTime = Main.GameUpdateCount;
            }
        }
예제 #14
0
 void Heal(Item item, Player player)
 {
     if (AffixItemItem.IsAccessoryEquipped(item, player) && (Main.GameUpdateCount - lastProcTime) >= (int)Math.Round(Type2.GetValue() * 60))
     {
         lastProcTime = Main.GameUpdateCount;
         int amount = Type1.GetValue();
         if (amount > 0)
         {
             player.statLife += amount;
             PoMEffectHelper.Heal(player, amount);
         }
         else
         {
             player.immune = false;
             player.Hurt(PlayerDeathReason.ByPlayer(player.whoAmI), -amount, 0, false);
         }
     }
 }
예제 #15
0
 void Hit(Item item, Player player)
 {
     if (item == player.HeldItem && (Main.GameUpdateCount - lastProcTime) >= (int)Math.Round(Type2.GetValue() * 60))
     {
         HealPlayer(player);
     }
 }