Example #1
0
        internal void SoulStoneBadLifeRegen()
        {
            if (HypothemaEffect && player.lifeRegen < 0 && (Focus.IsVitality() || Focus.IsTenacity()))
            {
                player.statDefense += 8;
            }

            if (UtilityCurse3 && player.lifeRegen < 0)
            {
                player.lifeRegen -= player.lifeRegen / 2;
            }

            if (VitalityCurse2 && player.lifeRegen < 0)
            {
                player.lifeRegen -= 2;
            }

            if (VitalityCurse3 && player.statLife >= player.statLifeMax2 / 2)
            {
                player.lifeRegen = 0;
            }

            if (VitalityCurse4)
            {
                if (player.statLifeMax2 > player.statLifeMax)
                {
                    player.statLifeMax2 = player.statLifeMax;
                }
            }

            if (EvilBossEffect && Focus.IsVitality())
            {
                if (player.lifeRegen < 0)
                {
                    player.lifeRegen += 2;
                }
                if (player.lifeRegen > -1)
                {
                    player.lifeRegen = -1;
                }
            }

            if (MoonLordEffect && Focus.IsUtility())
            {
                if (player.lifeRegen < 0)
                {
                    player.lifeRegen = 0;
                }
            }
        }
Example #2
0
        internal bool SoulStonePreHurt(bool pvp, bool quiet, ref int damage, ref int hitDirection, ref bool crit, ref bool customDamage, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource)
        {
            if (CancelNoKnockback)
            {
                player.noKnockback = false;
            }

            if (Focus == null)
            {
                return(true);
            }

            if (Focus.IsCapacity())
            {
                CapacityPreHurt(pvp, quiet, ref damage, ref hitDirection, ref crit, ref customDamage, ref playSound, ref genGore, ref damageSource);
            }

            if (Focus.IsMobility())
            {
                if (SkeletronEffect && Main.rand.Next(25) == 0)
                {
                    player.immune     = true;
                    player.immuneTime = 2 * 60;
                    return(false);
                }

                if (MoonLordEffect)
                {
                    int mobChance = 60;
                    mobChance -= (int)(Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y));

                    if (mobChance < 3)
                    {
                        mobChance = 3;
                    }

                    if (Main.rand.Next(mobChance) == 0)
                    {
                        player.immune     = true;
                        player.immuneTime = 2 * 60;

                        return(false);
                    }
                }
            }

            if (DestroyerEffect && !DestroyerCooldown && damage >= 50 && damage > player.statLife)
            {
                player.AddBuff(ModContent.BuffType <DestroyerSoulCooldownBuff>(), 90 * Constants.TICKS_PER_SECONDS);
                player.immune     = true;
                player.immuneTime = 2 * 60;

                return(false);
            }

            if (Focus.IsVitality())
            {
                if (SteamTrainEffect && !player.HasBuff(ModContent.BuffType <SteamTrainSoulCooldownBuff>()))
                {
                    if (player.statLife < player.statLifeMax2)
                    {
                        player.statLife = player.statLifeMax2;
                        player.AddBuff(ModContent.BuffType <SteamTrainSoulCooldownBuff>(), 150 * Constants.TICKS_PER_SECONDS);
                        player.immune     = true;
                        player.immuneTime = 2 * 60;

                        return(false);
                    }
                }

                if (MoonLordEffect && player.statLifeMax2 > 100 && damage >= player.statLife)
                {
                    MoonLordLifeMult   *= .5f;
                    player.statLifeMax2 = (int)(MoonLordLifeMult * player.statLifeMax2);
                    player.statLife     = player.statLifeMax2;
                    player.AddBuff(ModContent.BuffType <MoonLordSoulCooldownBuff>(), 90 * Constants.TICKS_PER_SECONDS);
                    player.immune     = true;
                    player.immuneTime = 2 * 60;

                    return(false);
                }
            }

            if (MoonLordEffect && !player.HasBuff(ModContent.BuffType <MoonLordSoulCooldownBuff>()) && Focus.IsTenacity())
            {
                player.AddBuff(ModContent.BuffType <MoonLordSoulCooldownBuff>(), 30 * Constants.TICKS_PER_SECONDS);
                player.immune     = true;
                player.immuneTime = 2 * 60;

                return(false);
            }

            return(true);
        }